﻿Ext.define('Admin.view.leaveapprove.LeaveApproveGrid', {
	extend: 'Ext.grid.Panel',
	xtype: 'leaveapprove-grid',
	id: 'leaveapprove-grid',
	title: '请假审批',		//需要修改
	iconCls: 'fa-arrow-circle-o-up',
	//cls: 'user-grid', //需要修改

	bind: '{leaveapproveStore}',//调用组件4
	//sm:new Ext.grid.CheckboxSelectionModel(),
	columns: [{ header: '工号', dataIndex: 'userId', width: 60, sortable: true }
		, { header: '开始时间', dataIndex: 'startTime', width: 150, sortable: true, renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s') }
		, { header: '结束时间', dataIndex: 'endTime', width: 150, sortable: true, renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s') }
		, { header: '申请时间', dataIndex: 'applyTime', width: 150, sortable: true, renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s') }
		, { header: '请假等级', dataIndex: 'leaveapproveType', width: 80, sortable: true }
		, { header: '请假原因', dataIndex: 'reason', width: 80, sortable: true }
		, {
		xtype: 'actioncolumn',
		items: [{
			xtype: 'button',
			iconCls: 'x-fa fa-pencil',
			tooltip: '签收',
			getClass: function (v, meta, rec) {
				if (rec.get('assignee') != '') {
					return 'x-hidden';
				}
				return 'x-fa fa-pencil';
			},
			handler: 'onClickLeaveApproveClaimButton'	//ajax  taskId
		}, {
			xtype: 'button',
			iconCls: 'x-fa fa-close',
			tooltip: '审批',
			getClass: function (v, meta, rec) {
				if (rec.get('assignee') == '') {
					return 'x-hidden';
				}
				return 'x-fa fa-close';
			},
			handler: 'onClickLeaveApproveCompleteWindowButton'	//taskDefinitionKey 动态表单
		}],
		cls: 'content-column',
		width: 120,
		dataIndex: 'bool',
		text: '操作',
		tooltip: 'edit '
	}
	],
	dockedItems: [{
		xtype: 'pagingtoolbar',
		dock: 'bottom',
		bind: '{leaveapproveStore}',	//调用组件4
		displayInfo: true,
		displayMsg: '显示第 {0} - {1} 条数据 总计 {2}',
		emptyMsg: "没有任何数据"
	}]
});
